package com.lilosoft.business.cga.service;

import com.lilosoft.business.cga.dao.EgsProjectsummaryMapper;
import com.lilosoft.business.cga.models.EgsProjectsummary;
import com.lilosoft.business.cga.models.EgsProjectsummaryExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小峰
 * Date: 2019-08-28
 * Time: 11:33
 */
@Service
public class EgsProjectsummaryService {
    @Autowired
    private EgsProjectsummaryMapper egsProjectsummaryMapper;

    public EgsProjectsummary selectByProjectId(String projectId) {
        EgsProjectsummaryExample example = new EgsProjectsummaryExample();
        EgsProjectsummaryExample.Criteria criteria = example.createCriteria();
        criteria.andProjectIdEqualTo(projectId);
        List<EgsProjectsummary> list = egsProjectsummaryMapper.selectByExampleWithBLOBs(example);
        if (null != list && list.size() > 0) {
            return list.get(0);
        }
        return null;
    }
}
